home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 569 / scpro241 / scdoc.txt < prev    next >
Text File  |  1992-04-30  |  22KB  |  505 lines

  1.                     Simple Computer Professional (SC Pro)
  2.                               Atari ST Version
  3.                                 by Paul Hruby 
  4.                     (c) 1990, 1991, 1992 Paul Hruby and 
  5.                               Micro Designs Ltd.
  6.                         Version 2.41        3/24/91
  7.  
  8.    Based on: SC for Macintosh, by Sherman Uitzetter
  9.              Applied Intelligence, Irvine, California.
  10.  
  11.  
  12.      The Simple Computer Professional (known from now on as SC or SC
  13. Pro),is designed to teach beginning programmers about low level
  14. machine language. Its lets the programmer design, test and
  15. finally run very small programs without very much knowledge on
  16. how a computer actually operates. It also shows graphically each
  17. instruction as it is executed.
  18.  
  19. Parts of the SC Machine
  20.  
  21.      The SC machine is divided up into a number of components:
  22.  
  23. CPU: The CPU is now called the Micro Designs 69000 CPU.
  24.  
  25. Memory: Most computers have two types of memory: Primary and
  26. Auxiliary memory. Primary memory is the computer's main memory.
  27. Auxiliary memory are devices such as hard drives, floppy disks
  28. and optical disks that store programs and data outside the
  29. computer's main memory. The SC uses only primary memory asits
  30. place to store computer programs and other data. The SC memory,
  31. unlike modern day computers, stores numbers in decimal digits
  32. rather than in binary digits. This makes its easy to look
  33. directly into memory and see the machine code. 
  34.  
  35. Each decimal number is stored in a address of its own. Only
  36. one instruction may be in each address cell. They may be accessed
  37. directly at any time (Random Access Memory). The SC's memory
  38. addresses are numbered from 0 to 99. Address 0 is considered ROM
  39. and may not be changed. Each address cell can only hold a 3 digit
  40. number at the most. This means the numerical range of values that
  41. may be placed in each memory address cell is between -999 to 999.
  42. The SC's memory is limited to only 100 cells with two digit
  43. numbers as addresses.
  44.  
  45. Input (IC): This device holds data or program instructions
  46. in what is known as cards. The SC is able to read these cards and
  47. place them in memory. Think of a card as a address cell that can
  48. only into memory. The input device only reads each input card in
  49. sequential order. They can not be randomly accessed (a little
  50. like a tape drive). Input cards may only hold three decimal
  51. digits and a negative sign. The sign is not needed if the number
  52. is positive. 
  53.  
  54. Output (OC): Output cards work the same way as input cards
  55. but they can not be placed into memory. Memory places data into
  56. the output cards in sequential order.
  57.  
  58. Accumulator (ACCUM): This is the first of the SC's three
  59. general purpose registers. The accumulator is used to preform
  60. math functions. When a number is placed in the accumulator it may
  61. be added to another number in memory, subtracted from a number
  62. number or even have its digits shifted left or right. The
  63. accumulator may also used to test for a negative value.
  64.  
  65. Instruction Register (IR): This register is a communications
  66. link between memory and the control unit. It holds the current
  67. instruction that the control unit is to execute. The SC uses a
  68. three digit positive number as its instruction. This instruction
  69. is placed (fetched) in to the Instruction Register from memory.
  70. This is done so the control unit knows what the next instruction
  71. is to execute.
  72.  
  73. Program Counter (PC): The third register on the SC. This
  74. register keeps track of the next program instruction to be
  75. executed. The value that the Program Counter displays is the
  76. address cell of that instruction. After each instruction is
  77. executed, the Program Counter is increamented by one. Hopfully,
  78. there is a instruction in that address cell. It is possible to
  79. change the current program counter to another part of memory.
  80. This is accumplished with the jump instruction.
  81.  
  82. Control Unit: The Control Unit manages the process of
  83. executing program instructions. The first thing it does is to
  84. fetch or load the instruction that the Program Counter is
  85. pointing to. It then places the instruction in the Instruction
  86. Register. It then increments the Program Counter by one. Next it
  87. decodes the opcode portion of the instruction. The opcode
  88. instruction is the left most digit of the three decimal digit
  89. instruction. For example, the instruction 432 is the instruction
  90. the Control Unit wants to execute. The 4 is the opcode
  91. instruction and 32 is the operand (i.e. value that is to be used
  92. by the instruction). Finally, the control unit will execute the
  93. instruction.  
  94.  
  95. The SC Instrunction Set. 
  96.  
  97. The SC computer has a set of ten instructions. They are as
  98. follows:
  99.  
  100.    Machine     Assembly 
  101.    Language    Language     Description
  102.    Code        Code
  103.  
  104.    0 _ _         INP        INPut - This instruction copies the 
  105.                             contents of the current input card  
  106.                             into memory address _ _ . It then 
  107.                             advances to the next input card. If
  108.                             the input card is blank, then it will
  109.                             advance the input device, set the PC
  110.                             to zero and stop the processor.
  111.  
  112.    1 _ _         OUT        OUTput - This instruction copies the
  113.                             contents of memory address _ _ and
  114.                             stores it in the output card. The   
  115.                             output device is then advanced to the
  116.                             next card.
  117.  
  118.    2 _ _         ADD        ADD - This instruction adds the
  119.                             contents of memory address _ _ to the
  120.                             current value in the accumulator. The
  121.                             result is then placed back in the
  122.                             accumulator.
  123.  
  124.    3 _ _         SUB        SUB - This instruction subtracts the 
  125.                             contents of memory address _ _ from
  126.                             the current value in the accumulator.
  127.                             The result is then placed back in the
  128.                             accumulator.
  129.  
  130.    4 _ _         LDA        LoaD Accumulator - This instruction
  131.                             clears the contents of the 
  132.                             accumulator and the copies the
  133.                             contents of memory address cell _ _
  134.                             into the accumulator.
  135.  
  136.    5 _ _         STA        STore Accumulator - The instruction 
  137.                             copies the least significant three 
  138.                             digits of the accumulator into 
  139.                             address cell _ _ .
  140.  
  141.    6 _ _         JMP        JuMP - This instruction copies the 
  142.                             present value of the PC into memory
  143.                             address 99. It then changes the PC to
  144.                             _ _ .
  145.  
  146.    7 _ _         TAC        Test ACcumulator - If the accumulator
  147.                             is a negative number then change the 
  148.                             PC to _ _ .
  149.  
  150.    8 x y         SHF        SHiFt - Shift the accumulator left x
  151.                             number of digits and then shift the
  152.                             accumulator right y number of digits.
  153.                             If all left shifts, zeros enter on 
  154.                             the right. If all right shifts, zeros
  155.                             zeros enter on the left.
  156.  
  157.    9 _ _         HLT        HaLT - Set the PC to _ _ and then 
  158.                             stop execution of the program.
  159.  
  160.  
  161. How to use SC Pro.
  162.  
  163. SC Pro will run on any Atari ST, STe or TT with at
  164. least 512K of free memory and a color monitor. It will run with
  165. any version of TOS from 1.0 to 1.6. I have not been able to test 
  166. it on a Mega STe or TT, but I don't see why it would not work.
  167.  
  168. The computer must be set to medium resolution before running SC Pro.
  169. Once the SC Pro icon is displayed in the desktop window, move the 
  170. mouse over to it and double click the icon.
  171.  
  172. Once loaded, you will be presented with main computer
  173. screen. In it you will find the right half of the screen is taken
  174. up by the SC's main memory. Each cell is numbered from 0 to 99. A
  175. ____ means there is nothing in the cell. Programs and data are
  176. stored here.
  177.  
  178. On the left side of the screen, on the top is the SC's
  179. registers. This holds the Accumulator (ACCUM: ), Instruction
  180. Register (IR: ), and finally the Program Counter (PC: ).
  181.  
  182. The box directly below the registers is the Status box.
  183. Certain pieces of information will be displayed in this box. It
  184. will also ask you for information at times.
  185.  
  186. Directly below the Status Box is the Input and Output cards
  187. box. The first eight input and output cards are displayed
  188. initaly. This box can be made to display other i/o cards by using
  189. the show input or show output from the menu bar. As a program
  190. enters values into the input or output cards, their appropriate
  191. window will scroll to display the current card.
  192.  
  193. In the bottom right hand corner of the screen, the current
  194. number of free memory cells is displayed. This is your free RAM
  195. gadge.
  196.  
  197. At the top there is a menu bar that holds all of the
  198. controls and tools of the SC machine. Each item on the menu bar
  199. has a keyboard equivalent printed next to it.  
  200.  
  201. Desk:
  202. About SC Pro - Keyboard equivalent: "A". This displays the
  203. name of the program, the version number, the programmer's name
  204. and a copyright notice.
  205.  
  206. File:
  207.  
  208. Load - Keyboard equivalent: "R". This option allows you to
  209. load a saved SC program from disk. The fileselector box will come
  210. up. Specify the drive, path and filename that the program is
  211. saved under. SC programs have a extention of .SC .
  212.  
  213. Save - Keyboard equivalent: "W". This options saves the
  214. current SC program in memory to disk. It also saves the input and
  215. output cards. When the fileselector box comes up, specify the
  216. drive, path and filename to save the program under. SC programs
  217. have a extention of .SC .
  218.  
  219. Print - Keyboard equivalent: "P". This option sends the
  220. contents of memory, input and output cards to a attached printer.
  221. Make sure the printer is on-line before continuing. It only
  222. prints address cells or cards that have something in them. It will
  223. also print the assembly code next to each memory instruction. 
  224.  
  225. Execute - Keyboard equivalent: "E". This option runs the
  226. program entered into memory. Before execution beings, SC will ask
  227. for the starting PC to begin execution at. If the current PC is ok, 
  228. press return and SC will use it, otherwise enter the value and press 
  229. return. If you do not want to run your program at this time, press the 
  230. right mouse button or "(" key on the keyboard. Once the PC is entered,
  231. SC will continue execution until the program is halted or an error 
  232. occures.
  233.  
  234. Step - Keyboard equivalent: "T". This option alows you to
  235. trace through the program as it executes. After each instruction
  236. is executed the program will wait for either the space bar to be
  237. pressed or the left mouse button to be clicked. 
  238.  
  239. Clear CPU - Keyboard equivalent: "C". This options allows
  240. the user to erase memory and input & output cards with one
  241. function. The user is given a warning before all data is erased.
  242. Memory and the input & output cards may be erased one by one with
  243. clear memory, clear input or clear output.
  244.  
  245. Clear Registers - Keyboard equivalent: "Z". This option allows the 
  246. user to reset the PC or the Accumulator and Instruction Register
  247. back to zero. 
  248.  
  249. Set Speed - Keyboard equivalent: "S". This option allows the
  250. user to vary the speed of program execution. When this command is
  251. selected, a dialog box comes up. Press a box 1-4 to vary the
  252. speed. (1 is the slowest, 4 is the fastest). SC Pro is initially
  253. set to the fastest speed. Press Ok to leave the dialog box. The
  254. user may also use the keyboard to change the speed. 
  255.  
  256. Quit - Keyboard equivalent: "Q". This command leaves SC Pro
  257. and returns you to the desktop.
  258.  
  259. Memory:
  260.  
  261. Load Memory - Keyboard equivalent: "M". This function allows
  262. the user to enter a program and/or data into the SC's main
  263. memory. When this function is used, the screen will blank out and
  264. display the current contents of memory. It will then ask the user
  265. for the starting memory location to enter data at. After that the
  266. user may enter program instructions one by one, hitting return
  267. after each instruction. Memory cells may be deleted by pressing 
  268. return at the prompt for data. Pressing ( or the right mouse 
  269. button will exit the load memory routine and return the user
  270. to the main SC Pro screen.    
  271.  
  272. Clear Memory - Keyboard equivalent: "V". This command will
  273. erase the contents of the SC's main memory. The user is given a
  274. warning before the main memory bits the dust in order to back
  275. out.
  276.  
  277. Input:
  278.  
  279. Load Input - Keyboard equivalent: "X". This function allows
  280. the user to enter data or program instructions into input cards.
  281. When this function is used, the screen will blank out and will
  282. display the current contents of the input cards. It will then ask
  283. the user for the starting input card to enter data at. After that
  284. the user may enter data or even program instructions into the
  285. input cards one by one. Press return after each piece of data.
  286. Input cards may be deleted by pressing return at the prompt for
  287. data. Pressing ( or the right mouse button will exit the load
  288. input routine and return the user to the main SC Pro screen.
  289.  
  290. Clear Input - Keyboard equivalent: "B". This function  will
  291. erase the contents of the SC's input cards. The user is given a
  292. warning before the cards are trashed.
  293.  
  294. Show Input - Keyboard equivalent: "I". This function allows
  295. the user to display a different portion of the input cards.  It
  296. will ask the user for a value from 0 to 92. Entering a value will
  297. display that input card and the next seven input cards in the
  298. input card window. Entering 92 will display input cards from 92
  299. to 99. The last 8 input cards.
  300.  
  301. Output:
  302.  
  303. Clear Output - Keyboard equivalent: "N". This function will
  304. erase the contents of the SC's output cards. The user is, of
  305. course, given a warning before the cards are vaporized.
  306.  
  307. Show Output - Keyboard equivalent: "O". This function allows
  308. the user to display a differenet portion of the output cards. It
  309. will ask the user for a vlaue from 0 to 92. Entering a value will
  310. display that output card and the next seven output cards in the
  311. output card window. Entering 92 will display output cards from 92
  312. to 99. The last 8 output cards.
  313.  
  314. HELP!:
  315.  
  316. The online help is divided into three sections, the SC command set,
  317. the menu bar and finally, the keypad. You may use the mouse or the
  318. + and - keys to page forward or back. Use the mouse or press return
  319. to quit.
  320.  
  321. The Keypad:
  322.  
  323. When SC Pro needs a value from you it will bring up a keypad on the
  324. screen. Use the left mouse button to press each key. The keyboard 
  325. may also be used to input values into SC Pro. If you input a number
  326. that you don't want, press the CLR or * key to clear it and start over.
  327. If you would like to delete a value in a cell, press return by itself
  328. and the value will be cleared. To stop entering values into cells, 
  329. press either the right mouse button or ( on the keyboard.
  330.  
  331.  
  332. Sample Programs:
  333.  
  334. Here are a few sample programs to test out you new toy. 
  335.  
  336. Addition - This program will add two numbers together and put the
  337. result in the output cards. (The contents is the machine language
  338. instructions, mnemoniecs are the english equivalents)
  339.  
  340. MEMORY:
  341.  ADDRESS  CONTENTS   MNEMONIECS      COMMENTS
  342.    20       040       INP 40    ;Address 40 get first #
  343.    21       041       INP 41    ;Address 41 get second #
  344.    22       440       LDA 40    ;Load accum with address 40
  345.    23       241       ADD 41    ;Add address 41 to accum.
  346.    24       542       STA 42    ;store accum in address 42
  347.    25       142       OUT 42    ;put address 42 in output cards
  348.    26       920       HLT 20    ;Stop the program & set PC to 20
  349.  
  350. INPUT CARDS:
  351.   CARD NO.     CONTENTS
  352.      0            15     ;first number to be added
  353.      1            25     ;second number to be added
  354.  
  355. Division - This program wil divide two numbers.
  356.  
  357. MEMORY:
  358.  ADDRESS  CONTENTS   MNEMONICES      COMMENTS
  359.    20       804         SHF 0,4   ;zero out accum
  360.    21       534         STA 34    ;set quotient to zero
  361.    22       035         INP 35    ;read in dividend into M
  362.    23       036         INP 36    ;read in divisor into N
  363.    24       435         LDA 35    ;load in M into accum
  364.    25       336         SUB 36    ;subtract N from M
  365.    26       732         TAC 32    ;if accum<0 goto cell 32
  366.    27       535         STA 35    ;store reduced dividend
  367.    28       434         LDA 34    ;load previous quotent
  368.    29       200         ADD 00    ;add one to quotent
  369.    30       534         STA 34    ;store quotent back in Q
  370.    31       624         JMP 24    ;jump back to cell 24
  371.    32       134         OUT 34    ;output quotent
  372.    33       900         HLT 00    ;Halt & reset PC to zero
  373.    34                             ;Q - The quotient
  374.    35                             ;M - The dividend
  375.    36                             ;N - The divisor
  376.  
  377. INPUT CARDS:
  378.   CARD NO.     CONTENTS    COMMENTS
  379.     0             10       ;dividend M
  380.     1              5       ;divisor N
  381.    
  382.  
  383. Also included in this lzh file are a number of programs to test the 
  384. SC with. Just set the PC to the starting instruction and being. I 
  385. believe they all have a starting PC of 20. Finally, I am including
  386. two NeoDesk 3 icons for SC Pro and it's program files.
  387.  
  388. Update Histroy
  389.  
  390. SC Pro 1.0  - Was a menu driven text based version of SC Pro. It had
  391. options to load memory and input cards. It could display memory, i/o
  392. and registers at any time. Finally, it could execute any program.
  393.  
  394. SC Pro 2.0 - Gem based version. This was an exact dublicate of SC for
  395. the Macintosh. This version was written as a final class project in a
  396. machine language class I took. Got an "A"!
  397.  
  398. SC Pro 2.2 - This version added a dialog box to place data into
  399. memory and input cards. Before, it was just a text based input
  400. system.
  401.  
  402. SC Pro 2.4 - In past versions, SC Pro had to completely redraw the
  403. screen when ever something changed. 2.4 now only changes whatever
  404. needs to be updated. This version also added a better load and save
  405. routine that would give error messages. Finally, this version saves
  406. the current desktop colors and restores them when quiting. It also
  407. checks for enough free memory to run and checks for medium res. 
  408.  
  409. SC Pro 2.41 - This version takes care of a few small bugs in the
  410. shifting command and other places. Load and save now remember the
  411. current disk path and displays a hour glass during disk access.
  412.  
  413. Known bugs:
  414.  
  415. Every so often, SC Pro will display bold characters when things are
  416. written to the screen. Once this bold characters are updated, the
  417. display get messed up. I blame GFA Basic 2.0 for having such a losely
  418. way of mixing text with graphics for this. If this happens, save what
  419. you are doing, exit to the desktop and re-run SC Pro. This should take
  420. care of it. SC Pro is currently being rewritten in a combination of C
  421. and Pascal to fix this problem and add a little speed. As always
  422. please report any bugs to the address below or leave E-mail on GEnie. 
  423.  
  424. Future Plans:
  425.  
  426. 1. Version 2.6 will hopefully be out RSN. <HA! HA!> It will
  427. allow SC Pro to be expanded just like a "real" computer. You can add
  428. things like the following:
  429.  
  430.     -- Extended memory - You can add 99 cell memory pages to the SC
  431. and be able to bank switch amoung them.
  432.     -- Graphics card - You will be able to do simple turtle graphics
  433. in four colors.
  434.     -- Sound card - At least three sound channels. Maybe even through
  435. the STe's audio ports.
  436.     -- Math Co-processor - Will allow SC Pro to multiply, divide and
  437. other math functions without writting it yourself.
  438.     -- MD69010 CPU - This new CPU will have a number of general
  439. registers, stack, pointer and other options.
  440.  
  441. 2. I am working on improving the graphical interface to include more
  442. windows, dialog boxes and sliders. 
  443.  
  444. 3. Version 2.6 will also run in high res!
  445.  
  446.  
  447. These enhancements can and will only happen if you make yourself a
  448. registered user. So far, I have 76 registered users and three schools
  449. across the country. Lets try and make it an even 100! See below for
  450. more details. 
  451.  
  452.  
  453. Copyright Information
  454.  
  455.  
  456. SC Pro (SCPRO241.PRG), all SC programs included in this LZH file,
  457. (ABS.SC, ADD.SC, BOOTSTRP.SC, DIVIDE.SC, LDEXECT.SC, MAX_NUM.SC,
  458. MULTIPLY.SC and SHIFTING.SC), SC Pro NeoDesk 3 icons (SC.NIC), and the
  459. documentation (SCDOC.TXT) are:
  460.  
  461.      Copyright = 1990, 1991, 1992 Paul Hruby and Micro Designs Ltd.
  462.  
  463.      All rights reserved. 
  464.  
  465. SC Pro is distributed as SHAREWARE. This means that you are free
  466. (under the conditions explained below) to give copies of the program
  467. to friends, upload it to bulletin boards, etc. If you end up using the
  468. program, you are expected to become a registered user by sending a
  469. shareware payment of at least $15.00 to:
  470.  
  471.       Paul Hruby
  472.       100 Aberdeen Drive, Box #237
  473.       Riverside, Ca. 92507
  474.  
  475. Shareware can a feasible alternative to the normal means of
  476. distribution; but it will only work if you do send in your
  477. registration fee. So if you'd like to see further updates to SC Pro
  478. and other useful shareware programs, your support will make a
  479. difference!
  480.  
  481. If you have suggestions for improving SC Pro, your opinions will carry
  482. more weight if you're registered; You can reach me at the above
  483. address.
  484.  
  485. If you would like an acknowledgement that I've received your
  486. registration fee, please include a self-addressed stamped envelope
  487. along with your payment.
  488.  
  489. SC Pro may be freely distributed as long as all of the above-mentioned
  490. files are included, and as long as none of the files are altered in
  491. any way whatsoever. The program may not be sold or included with a
  492. commerical product without the express written consent of the author.
  493. Also, this documentation may not be reprinted without the express
  494. written consent of the author.
  495.  
  496. SC Pro 2.41
  497. Paul Hruby
  498. 100 Aberdeen Drive, Box £ 237
  499. Riverside, Ca. 92507
  500. GEnie E-mail: P.HRUBY
  501.  
  502. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  503.                                  SC Pro
  504.  
  505.